<!--
 * @Description: In User Settings Edit

 * @Author: your name
 * @Date: 2019-08-03 08:58:45
 * @LastEditTime: 2019-08-10 14:28:15
 * @LastEditors: Please set LastEditors
 -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        body {
            height: 2000px;
            background: #fff;
            display: flex;
            flex-direction: column;
        }

        #head {
            width: 100%;
            height: 200px;
            background: lightblue;

        }

        #menu {
            width: 100%;
            flex: 1;

        }

        #foot {
            width: 100%;
            height: 200px;
            background: lightblue;

        }

        .fiex {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
        }

        input {
            float: right;
        }
    </style>
</head>

<body>
    <div id="head">

    </div>
    <div id="menu">

    </div>
    <div id="foot">
        <input type="button" value="X" id="btn">
    </div>
</body>
<script>
    (function () {
        var foot = document.getElementById('foot');
        var btn = document.getElementById('btn');
        window.onscroll = function () {
            var scrolltop = window.scrollY;
            if (scrolltop >= 400) {
                foot.className = 'fiex';
            } else {
                foot.className = '';
            }

        }

        btn.onclick = function () {
            foot.className = '';
            btn.type = '';
            setTimeout(function () {
                foot.className = 'fiex';
            }, 10000)
        }
    })();
</script>

</html>